JBoss Community Archive (Read Only)

RHQ 4.7

Apache 2.x Product Configuration

Overview

The RHQ apache plugin can auto-discover any Apache 2.x instances running on the Agent machine. However, in order to collect traits or numeric metrics, the Apache SNMP module must be configured in the Apache instance; and, in order to collect HTTP response times, the Response Time (RT) module must be configured in the Apache instance.

SNMP Module Configuration

Important Notes

  • Due to licensing issues, The SNMP connectors are available only with the JBoss Operations Network (JON) product, which is built on RHQ. The Apache SNMP connectors can be downloaded from the JON GUI (starting with JON 2.2) by navigating to Administration->Downloads. In previous JON 2.x versions, the connectors were packaged with the Agent distribution. Download and unzip in order to perform the steps below.

  • In order to use the SNMP module, the Apache server needs to have been compiled with shared object support (configure --enable-so).

  • Apache 2.2 is not supported on Windows.

  • Before building the modules under Solaris, refer to: http://net-snmp.sourceforge.net/wiki/index.php/FAQ:Compiling_01 and http://net-snmp.sourceforge.net/wiki/index.php/FAQ:Agent_39

Required Steps

Perform the following steps to setup the SNMP module:

1. Compile the module.

Linux

NOTE: In order to compile the SNMP module, apxs, perl, make, and automake must all be installed and in your PATH.

Binaries of the module are provided for Linux-x86 and Linux-x64. If you are running Apache on one of these platforms, extract these binaries as follows, where <APACHE_VERSION> is either "2.0" or "2.2":

  • for Linux-x86:

    cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources
    tar xjvf ../binaries/snmp_module-x86-linux-apache<APACHE_VERSION>.tar.bz2
  • for Linux-x64:

    cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources
    unzip ../binaries/snmp_module-x64-linux-apache<APACHE_VERSION>.zip

Otherwise, run the following commands to compile the module, where <APACHE_2.x_INSTALL_DIR> is the installation directory for the Apache server for which you are compiling the module, and <APACHE_VERSION> is either "2.0" or "2.2":

cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources
./build_apache_snmp.sh <APACHE_VERSION> <APACHE_2.x_INSTALL_DIR>/bin/apxs
Windows

The 2.0 module is provided in binary form for Windows and therefore no compilation is required.

2. Install the module.

UNIX
cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources/snmp_module_<APACHE_VERSION>
cp module/* <APACHE_2.x_INSTALL_DIR>/modules
cp conf/* <APACHE_2.x_INSTALL_DIR>/conf
mkdir <APACHE_2.x_INSTALL_DIR>/var
chmod 777 <APACHE_2.x_INSTALL_DIR>/var
Windows
xcopy /e <JON_AGENT_INSTALL_DIR>\product_connectors\apache-snmp\binaries\x86-winnt-apache2.0\* <APACHE_2.0_INSTALL_DIR>

If you need to monitor more than one Apache instance on the same machine, you will need to make sure the agentaddress property in <APACHE_2.x_INSTALL_DIR>/conf/snmpd.conf has a different value for each instance. See the snmpd.conf manpage for a description of this property's syntax.

3. Enable the module in httpd.conf.

Linux

Edit <APACHE_2.x_INSTALL_DIR>/conf/httpd.conf. At the end of the file, add the following lines:

LoadModule snmpcommon_module modules/libsnmpcommon.so
LoadModule snmpagt_module modules/libsnmpmonagt.so

SNMPConf conf
SNMPVar var
Windows

Edit <APACHE_2.x_INSTALL_DIR>/conf/httpd.conf. At the end of the file, add the following lines:

LoadModule snmpcommon_module modules/snmpcommon.so
LoadModule snmpagt_module modules/snmpmonagt.so

SNMPConf conf
SNMPVar var

ServerName

Make sure the "main" Apache configuration section, as well as each VirtualHost configuration block, contains a ServerName directive, which includes a port. The SNMP module uses this directive to uniquely identify the main server and each virtual host, so please ensure that all ServerNames have unique values. For example:

ServerName main.example.com:80
...

<VirtualHost vhost1.example.com:80>
ServerName vhost1.example.com:80
...
</VirtualHost>

4. Restart the Apache server.

Windows

To restart Apache, run the following command:

<APACHE_2.x_INSTALL_DIR>/bin/apachectl restart
UNIX

To restart Apache, run the following command:

<APACHE_2.0_INSTALL_DIR>\bin\Apache -k restart

5. Verify the SNMP module installation.

To confirm that the SNMP module was installed successfully, run the following command:

grep SNMP <APACHE_2.x_INSTALL_DIR>/logs/error_log

Please also confirm that the output contains lines similar to the following:

[Wed Mar 19 09:54:34 2008] [notice] Apache/2.0.63 (Unix) CovalentSNMP/2.3.0 configured -- resuming normal operations
[Wed Mar 19 09:54:35 2008] [notice] SNMP: CovalentSNMP/2.3.0 started (user '1000' - SNMP address '1610' - pid '26738')

Response Time Module Configuration

In order to collect per-URL response time metrics for an Apache server, the Response Time (RT) module must be configured on that Apache server.

Important Notes

  • In order to use the RT module, the Apache server needs to have been compiled with shared object support (configure --enable-so).

Required Steps

Perform the following steps to setup the RT module:

1. Compile and install the module.

NOTE: In order to compile the RT module, apxs must be installed, and make must be installed and in your PATH.

cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-rt/sources
chmod +x build_apache_module.sh
./build_apache_module.sh 2.x <APACHE_2.x_INSTALL_DIR>/bin/apxs
cp apache2.x/.libs/mod_rt.so <APACHE_2.x_INSTALL_DIR>/modules
Windows

Run the following command, where <APACHE_2.x_INSTALL_DIR> is the installation directory for the Apache server:

xcopy /e <JON_AGENT_INSTALL_DIR>\product_connectors\apache-rt\binaries\x86-winnt-apache2.0\* <APACHE_2.x_INSTALL_DIR>

2. Enable the module in httpd.conf.

At the very end of the httpd.conf file, add the following line:

LoadModule rt_module modules/mod_rt.so
LogFormat "%S" rt_log

To configure RT logging for the "main" Apache server, add the following line somewhere at the top level of the file:

CustomLog logs/myhost.com80_rt.log rt_log

NOTE: The letter S inside the quotes must be in upper case.

To configure RT logging for a virtual host, add the following line somewhere within the VirtualHost block:

CustomLog logs/myhost.com8080_rt.log rt_log

Make sure the RT log file name is different for the main server and each virtual host. It is recommended that the host and port from the ServerName directive be used to form the file name as follows:

<host><port>_rt.log

3. Restart the Apache server.

Run the following command to restart Apache:

cd <APACHE_2.x_INSTALL_DIR>/bin
./apachectl restart

To confirm that the RT module was installed successfully, check that the RT log files configured via the CustomLog directive now exist.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-12 14:42:00 UTC, last content change 2013-03-14 09:29:33 UTC.